<template>
	<view>
		<view class="top">
			<view class="province">
				<image
					src="https://cdn3.axureshop.com/demo/2116044/images/%E9%80%89%E6%8B%A9%E9%97%A8%E5%BA%97/u1847.png">
				</image>
				<text>上海市</text>
				<image
					src="https://cdn3.axureshop.com/demo/2116044/images/%E9%80%89%E6%8B%A9%E9%97%A8%E5%BA%97/u1849.png">
				</image>
			</view>
			<view @click="search">
				<view class="search">
					<image
						src="https://cdn3.axureshop.com/demo/2116044/images/%E9%80%89%E6%8B%A9%E5%9F%8E%E5%B8%82/u1812.png">
					</image>
					<text>搜索</text>
				</view>
			</view>
		</view>
		<view class="shop">

			<view class="items" v-for="(v,i) in list">
				<view class="item">
					<view class="left">
						<view class="left1">
							<text>{{v.name}}</text>
						</view>
						<view class="left2">
							<text>1.2km</text>
							<text>上海市静安区江场三路134号</text>
						</view>
						<view class="left3">
							<text>{{v.status}}</text>
							<text>10:00-22:00</text>
						</view>
					</view>
					<view class="center">
						<image
							src="https://cdn3.axureshop.com/demo/2116044/images/%E7%BB%84%E4%BB%B6_%E8%A7%84%E8%8C%83/u634.png">
						</image>
					</view>
					<view class="right">
						<view class="right1">
							<text @click="goOrder(v.id)">排队取号</text>
						</view>
						<view class="right2">
							<view class="icon" @click="getphone">
								<image
									src="https://cdn3.axureshop.com/demo/2116044/images/%E7%BB%84%E4%BB%B6_%E8%A7%84%E8%8C%83/u637.png">
								</image>
							</view>
							<view class="icon">
								<image
									src="https://cdn3.axureshop.com/demo/2116044/images/%E7%BB%84%E4%BB%B6_%E8%A7%84%E8%8C%83/u640.png">
								</image>
							</view>
						</view>
					</view>
				</view>
				<view class="line">
					<image
						src="https://cdn3.axureshop.com/demo/2116044/images/%E7%BB%84%E4%BB%B6_%E8%A7%84%E8%8C%83/u664.png">
					</image>
				</view>
				<view class="bot">
					<text>当前有</text>
					<text>{{v.awaitNumber}}</text>
					<text>桌正在等位</text>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import http from '@/utils/http.js'
	export default {
		data() {
			return {
				list: [{
					id: '',
					status: '',
					awaitNum: '',
					name: '',
					
				}],
				state:3,
				call:''
			}
		},
		
		// onBackPress(e) {
		// 	console.log('返回');
		// 	uni.navigateBack({
		// 		delta:2,
		// 		});
		// 		// return true;
		// },
		// onNavigationBarButtonTap() {
		// 	console.log('返回');
		// 	uni.navigateBack({
		// 		delta: 1000,
		// 		})
		// },
		methods: {
			onShow() {
				this.get();
			},
			get() {
				http({
					url: '/checkhall',
					success: (res) => {
						console.log(res)
						if (res.data) {
							this.list = res.data.data;
						}
					}
				})
			},
			search() {
				// console.log(this.state);
				uni.redirectTo({
					url: "/pages/search/search?state="+this.state
				});
			},
			goOrder(key){
				console.log('this.id='+key);
				uni.navigateTo({
					url: "/pages/takeNum/takeNum?id="+key
				});
			}
		}
	}
</script>

<style>
	page {
		background-color: rgba(245, 247, 247, 1);
	}

	.top {
		background-color: #ffffff;
		width: 750rpx;
		height: 100rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.top>view:last-child {
		margin-right: 30rpx;

	}

	.province {
		width: 150rpx;
		margin: 0 30rpx;
	}

	.province image:nth-child(1) {
		width: 25rpx;
		height: 30rpx;
		margin-right: 10rpx;
	}

	.province image:nth-child(3) {
		width: 15rpx;
		height: 20rpx;
	}

	.province text {
		color: #333333;
		font-size: 24rpx;
		margin-right: 10rpx;
		margin-bottom: 5rpx;
	}

	.search {
		width: 160rpx;
		height: 70rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 1px solid rgba(239, 239, 239, 1);
		border-radius: 40rpx;
	}

	.search image {
		width: 35rpx;
		height: 35rpx;
		margin-right: 15rpx;
	}

	.search text {
		color: #cccccc;
		font-size: 28rpx;
	}

	.items {
		padding: 30rpx, 0;
		background-color: #ffffff;
		margin: 40rpx;
		width: 670rpx;
		height: 330rpx;
		border: 1px solid rgba(239, 239, 239, 1);
		border-radius: 20rpx;
	}

	.item {

		width: 670rpx;
		height: 240rpx;

		display: flex;
		align-items: center;
	}

	.left {
		flex: 1;
		display: flex;
		flex-direction: column;
		margin-left: 30rpx;
	}

	.left1 {
		color: #333333;
		font-size: 34rpx;
		margin-bottom: 25rpx;
	}

	.left2 text {
		margin-right: 15rpx;
	}

	.left2 {
		color: #999999;
		font-size: 26rpx;
		margin-bottom: 25rpx;
	}

	.left3 text:first-child {
		background-color: rgba(247, 114, 20, 0.09803921568627);
		padding: 5rpx 12rpx;
		font-size: 28rpx;
		color: #F77214;
		border-radius: 10rpx;
		margin-right: 15rpx;
	}

	.left3 text:last-child {
		color: #999999;
		font-size: 26rpx;
	}

	.center {
		width: 1rpx;
		height: 200rpx;
	}

	.center image {
		width: 1rpx;
		height: 200rpx;
	}

	.right {
		width: 170rpx;
		margin-left: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.right1 {
		font-size: 32rpx;
		color: #F77214;
		margin-bottom: 25rpx;
		font-size: 400;
	}

	.right2 {
		display: flex;
	}

	.icon {
		background-color: rgba(247, 114, 20, 0.0980392156862745);
		border-radius: 50rpx;
		width: 60rpx;
		height: 60rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		margin: 10rpx 15rpx;
	}

	.right2 view image {
		width: 30rpx;
		height: 35rpx;
	}

	.line {
		width: 670rpx;
		margin-top: -30rpx;
		margin-bottom: 18rpx;
	}

	.line image {
		width: 670rpx;
		height: 1rpx;
	}

	.bot {
		width: 670rpx;

		display: flex;
		justify-content: flex-end;
		align-items: center;
	}

	.bot text:nth-child(1) {
		font-size: 28rpx;
		color: #333333;
	}

	.bot text:nth-child(2) {
		font-size: 28rpx;
		color: #F77214;
		font-weight: 600;
		margin: 0 10rpx;
	}

	.bot text:nth-child(3) {
		font-size: 28rpx;
		color: #333333;
		margin-right: 30rpx;
	}
</style>
